package com.gaga.console.core.entity.dto;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.UUID;
import com.alibaba.fastjson.JSON;
import com.gaga.common.utils.AESUtils;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 话术vo
 * </p>
 *
 * @author liujia
 * @since 2022-05-19
 */
@Data
@Accessors(chain = true)
public class SecretKeyDto implements Serializable {

    private Date endDate;

    private String seccretKey;

    public static void main(String[] args) throws Exception {
        SecretKeyDto secretKeyDto = new SecretKeyDto();

        secretKeyDto.setEndDate(DateUtil.parse("2025-06-13"));
        secretKeyDto.setSeccretKey(UUID.fastUUID().toString(true));
        String encrypt = AESUtils.encrypt(JSON.toJSONString(secretKeyDto));

        System.out.println(encrypt);
        System.out.println(AESUtils.decrypt(encrypt));
    }

}
